pp108 : createdatabaseconfiguration - Ant Task

createdatabaseconfiguration - Ant Task

Description

createdatabaseconfiguration Ant task creates a database configuration based on the parameters provided.

Sample Usage

  1. The following XML code describes the procedure to create a database configuration using MySQL along with JDBC.
    <createdatabaseconfiguration description="northwindConfiguration"
        ldapRoot="cn=cordys,cn=mybop,o=myorg.com" name="northwindConf"
        organization="system" override="false" server="cin400333l" testConnectivity="true">
        <driver connectionString="jdbc:mysql://localhost:3307/northwind"
            dbConnectorType="JDBC" dbVendor="MySQL 5.0"
            jdbcDriverClass="com.mysql.jdbc.Driver" jdbcDriverXAClass="com.mysql.jdbc.jdbc2.optional.MysqlXADataSource"/>
        <database createDatabase="true" dbPassword="userpasswd"
            dbUserName="user" dbaName="root" dbaPassword="rootpasswd" defaultDatabaseName="northwind"/>
    </createdatabaseconfiguration>
    
  2. The following XML code describes the procedure to create database configuration using SQL Server along with OLEDB.
<createdatabaseconfiguration description="MyTestConfiguration"
    ldapRoot="cn=cordys,cn=mybop,o=myorg.com" name="MyTestConfig"
    organization="system" override="false" server="cin400333l" testConnectivity="true">
    <driver dbConnectorType="OLEDB" dbServerName="cin400333l\SQLEXPRESS"
        dbVendor="MS SQL Server 2005" provider="SQLNCLI"/>
    <database createDatabase="false" dbPassword="userpassword"
        dbUserName="username" defaultDatabaseName="testDB"/>
</createdatabaseconfiguration>

Parameters

Attribute

Description

Type

Required

name

Name of the database configuration.

String

Yes

description

Description of the database configuration. If the value is empty, name will be taken as description.

String

No

server

Name of the system where Process Platform is installed.

String

Yes

ldapRoot

LDAP Root DN of Process Platform instance.

String

Yes

organization

Name of the organization where database configuration needs to be created.

String

Yes

testConnectivity

  • If true, checks the status of database connection and creates the database configuration only if the connection is successful.
  • If false, skips the connection status and creates database configuration directly.
    Default value is true

boolean

No

override

Flag to update the database configuration if it is already present. Default value is false

boolean

No

failOnError

This flag aborts the build when an exception occurs in the task. Default value is true

boolean

No

Parameters for database and driver

It has two nested elements called 'database' and 'driver'. These attributes are explained in the following table:

Attributes of database element

Attribute

Description

Type

Required

defaultDatabaseName

Refers to the name of the database. For Oracle, the attribute is the Schema name.

String

Yes

dbUserName

Refers to the database user ID/ user name.

String

Yes

dbPassword

Refers to the database user password.

String

Yes

createDatabase

Boolean value indicates whether new database should be created while creating database configuration. Default value is false

boolean

No

dbaName

Database administrator name to create new database.This property is needed only if createDatabase is set to true.

String

No

dbaPassword

Refers to the Database administrator password to create a new database. This property is needed only if createDatabase is set to true.

String

No

createTablespace

This boolean flag is specific to oracle and createDatabase = true. This should be set to true if tablespace is created while creating database, otherwise set to false. Default value is false

boolean

No

tablespace

Refers to the tablespace name. This field is needed only if createDatabase = true, createTablespace = true and dbVendor = Oracle.

String

No

tablespacePath

Refers to the tablespace path. This field is needed only if createDatabase = true, createTablespace = true and dbVendor = Oracle.

String

No

Attributes of driver element

If the driver is OLEDB

Attribute

Description

Type

Required

dbVendor

Name of the database vendor. Currently supported values are:

  1. MS SQL Server 2005
  2. MS SQL Server 2008
  3. Oracle 10g
  4. Oracle 11g
  5. ODBC
  6. Others

String

Yes

dbConnectorType

Refers to the type of the connector used. Possible value is OLEDB.

String

Yes

provider

Name of the Database provider. If it is empty, the default values will be:

  • SQLNCLI if dbVendor is MS SQL Server 2005
  • SQLNCLI10 if dbVendor is MS SQL Server 2008
  • MSDASQL if dbVendor is ODBC.

String

No.

dbServerName

Refers to the DB Server String.

  • For Oracle, the value will be <DB Server Name/SID(or)ServiceName>
  • For MS SQL, the value will be <DB Server Name\Instance Name>
  • For ODBC, the value will be <Data Source Name(DSN)>

String

Yes

If the driver is JDBC

Attribute

Description

Type

Required

dbVendor

Name of the database vendor. Currently supported values are:

  1. MS SQL Server 2005
  2. MS SQL Server 2008
  3. MySQL 5.1
  4. MySQL 5.5
  5. Oracle 10g
  6. Oracle 11g
  7. Others

String

Yes

dbConnectorType

Type of the connector used. Possible value is JDBC.

String

Yes

jdbcDriverClass

Qualified name of the JDBC driver class. If it is empty, the default values will be:

  • oracle.jdbc.driver.OracleDriver if dbVendor is Oracle
  • com.microsoft.sqlserver.jdbc.SQLServerDriver if dbVendor is either MS SQL Server 2005 or 2008
  • com.mysql.jdbc.Driver if dbVendor is MySQL

String

No

jdbcDriverXAClass

Qualified name of the JDBC driver XA class. If it is empty, the default values will be:

  • oracle.jdbc.xa.client.OracleXADataSource if dbVendor is Oracle
  • com.microsoft.sqlserver.jdbc.SQLServerXADataSource if dbVendor is either MS SQL Server 2005 or 2008
  • com.mysql.jdbc.jdbc2.optional.MysqlXADataSource if dbVendor is MySQL

String

No

connectionString

  • For Oracle OCI,the value will be
    jdbc:oracle:oci:@<TNS_NAMES_ALIAS>
    • TNS_NAMES_ALIAS => tnsnames.ora file entry
  • For Oracle Thin, the value will be
    jdbc:oracle:thin:@<db_server_name>:<port_no>:<SID(or)Service_Name> 
  • For MS SQL Server 2005 and 2008, the value will be
    jdbc:sqlserver://<db_server_name>:<port_no>
  • For MySQL, the value will be
    jdbc:mysql://<db_server_name>:<port_no>

String

Yes

Note:

  • New database cannot be created if ODBC Connection is used.